package com.weixin.xplore.controller;

import com.weixin.xplore.config.CommonResult;
import com.weixin.xplore.controller.domain.request.GoodQueryRequest;
import com.weixin.xplore.dao.entity.Good;
import com.weixin.xplore.service.GoodBizService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/good")
@RequiredArgsConstructor
public class GoodController {
    private final GoodBizService goodBizService;

    @Operation(summary = "商品列表")
    @PostMapping("/page")
    public CommonResult<String> page(@RequestBody GoodQueryRequest goodQueryRequest) {
        return CommonResult.data(goodBizService.page(goodQueryRequest));
    }
}
